<?php

function GENERATE_SMTP_MAIL($mailTo, $fromEmail, $fromName, $cc='', $bcc='', $subject , $message)
{
	require_once('smtp/class.phpmailer.php');
	//error_reporting(1);
	
	$mailto = $mailTo;
	$cc = $cc;
	$bcc = $bcc;
	$email = $fromEmail;
	 
	//SMTP FUNCTION
	
	$mail  = new PHPMailer();
	$mail->IsSMTP(); // telling the class to use SMTP
	$mail->SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
	$mail->SMTPAuth   = true;                  // enable SMTP authentication
	
	$mail->IsHTML(true);
	//$mail->Host ="globaltodo.com";
	$mail->Host ="mail.vfix.biz";
	$mail->Port = 25;
	//$mail->Username = "listings";
	//$mail->Password = "gtdlist";
	$mail->Username = "mnazdhjv";
	$mail->Password = "b50qf2W0Rf";
		
	$mail->SetFrom($email, $fromName);
	$mail->Subject    = $subject;
	
	//$mail->MsgHTML($message);
	
	$mail->ContentType = "text/html";
	$mail->CharSet  = 'UTF-8'; 
	
	
	$mail->Body = $message;
	$address = $mailto;
	
	$mail->AddAddress($mailto, $fromName);
	
	if(!$mail->Send()) {
	  $emailerror= $mail->ErrorInfo;
	  //$emailerror = "Message sent successfully!";
	} else {
		$emailerror= $mail->ErrorInfo;
	 //$emailerror = "Message sent successfully!";
	}	
	return $emailerror;
}